<script type="text/javascript">
	$(document).ready(function(){
		$( "#from" ).datepicker({
		  dateFormat: "yy-mm-dd",
     	  //showButtonPanel: true,
		  defaultDate: "+1w",
		  changeMonth: true,
		  changeYear: true,
		  numberOfMonths: 1,
		  onClose: function( selectedDate ) {
			$( "#to" ).datepicker( "option", "minDate", selectedDate );
		  }
		});
		$( "#to" ).datepicker({
		  dateFormat: "yy-mm-dd",
		  //showButtonPanel: true,
		  defaultDate: "+1w",
		  changeMonth: true,
		  changeYear: true,
		  numberOfMonths: 1,
		  onClose: function( selectedDate ) {
			$( "#from" ).datepicker( "option", "maxDate", selectedDate );
		  }
		});
	});
</script>

<?php
	require("includes/connect.php");
	//include("includes/function.php");
	$db = new myDBS;
?>

<form action="rptChequeByExpenses.php" method="post" target="_blank">
<div class="form-inline">
<label for="from">From</label>
<input type="text" id="from" name="from" required />
<label for="to">to</label>
<input type="text" id="to" name="to" required />
</div>
<label>หมวด / ลักษณะ</label>
	<select class="span5" id="ex1_id" name="ex1_id" >
	<?php 
		$result = $db->showData("expenses_lvl1");

		echo "<option value='%%'>ทั้งหมด</option>";
		while($rows = $db->fetch_object ( $result )) {
			echo "<option value='$rows->expenses1_id'>$rows->expenses1_name</option>";
		}
	?>

	</select>
	
	<button type="submit" id="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i> ดูรายงาน</button>
</form>